package chapter8.practice;

import java.util.ArrayList;
import java.util.List;

public class ListOperate {
    public static void main(String[] args) {
        List list = new ArrayList();
        for (int i = 0; i < 10; i++) {
            list.add("practice" + i);
        }
        System.out.println(list);
        System.out.println("获取索引5处的元素:" + list.get(5));
        System.out.println("元素practice3的索引位置为:" + list.indexOf("practice3"));
        System.out.println("元素practice6的索引位置为:" + list.indexOf("practice6"));
        list.remove(3);
        System.out.println(list);
    }
}
